var API_URL = 'http://192.168.6.204:8080/newchinalifeinterface/';
//var API_URL = 'http://www.ladyflora.com/newchinalifeinterface/';
var openid = getQueryString("openid");
var agentid = getQueryString("agentid"); //发布图文/视频 时,传入
var user_status = getQueryString("user_status"); //用户状态  1 讲师  2 非讲师  3 游客

/*
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?5a02bd50732b8338bfa81fc281bca99a";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
*/
/**
 * 获取地址栏的值
 * @param param
 * @returns {*}
 */
function getQueryString(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
	var r = window.location.search.substr(1).match(reg);
	if (r != null) return unescape(r[2]); return null;
}

/**
 * 格式化时间
 * @param format
 * @returns {*}
 */
Date.prototype.format =function(format)
{
	var o = {
		"M+" : this.getMonth()+1, //month
		"d+" : this.getDate(), //day
		"h+" : this.getHours(), //hour
		"m+" : this.getMinutes(), //minute
		"s+" : this.getSeconds() //second
	};
	if(/(y+)/.test(format)){
		format=format.replace(RegExp.$1,(this.getFullYear()+"").substr(4- RegExp.$1.length));

	}
	for(var k in o){
		if(new RegExp("("+ k +")").test(format)){
		format = format.replace(RegExp.$1,RegExp.$1.length==1? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));
		}
	}
	return format;
};
//点击查看大图
function imgOrgin(){
    $('.detials_img').on('click',function(event){
        event.stopPropagation();
        var img_orgin = $(this).clone(true);
        $(".imgorgin").html(img_orgin);
        $(".imgorgin").fadeIn('fast');
        $(".imgorgin .detials_img").on('click',function(){
            $(".imgorgin").hide();
        });
    });
    $(".imgorgin").on('click',function(){
        $(".imgorgin").hide();
    });
};